package com.haoshuang.zhouzhoubang.ui.page.order.take.record

import android.content.Context
import android.os.Bundle
import com.haoshuang.zhouzhoubang.databinding.ActivityTakeOrderRecordBinding
import com.haoshuang.zhouzhoubang.ui.adapter.ViewPagerAdapter
import com.haoshuang.zhouzhoubang.ui.page.order.take.record.fragment.TakeOrderRecordChildFragment
import com.mufeng.libs.base.BaseVMActivity
import com.mufeng.libs.utils.view.click
import com.mufeng.libs.utils.startPage

/**
 *  门店下单记录
 */
class TakeOrderRecordActivity :
    BaseVMActivity<TakeOrderRecordViewModel, ActivityTakeOrderRecordBinding>() {

    companion object {
        fun launch(context: Context) {
            context.startPage<TakeOrderRecordActivity>()
        }
    }

    private val titles = arrayListOf("未支付", "已支付", "已取消")
    private val fragments = arrayListOf(
        TakeOrderRecordChildFragment.getInstance(1),
        TakeOrderRecordChildFragment.getInstance(2),
        TakeOrderRecordChildFragment.getInstance(3)
    )

    override fun initView(savedInstanceState: Bundle?) {
        binding.titleBar.title = "下单记录"
        binding.titleBar.leftImageView().click { finish() }

        val adapter = ViewPagerAdapter(supportFragmentManager, lifecycle, fragments)
        binding.viewPager.adapter = adapter
        binding.slidingTabLayout.setViewPager2(binding.viewPager, titles)
    }

    override fun initData() {
    }

    override fun startObserve() {
    }

}